COMPONENT=SensoBygAppC
CFLAGS += -I$(TOSDIR)/lib/net \
          -I$(TOSDIR)/lib/net/le \
          -I$(TOSDIR)/lib/net/ctp
CFLAGS += -I$(TOSDIR)/lib/net/drip
CFLAGS += -I$(TOSDIR)/lib/serial
          
BUILD_EXTRA_DEPS += java-files SerialDataMsg.py
CLEAN_EXTRA = *.class *.pyc SerialDataMsg.py simbuild build doc app.xml java

SerialDataMsg.py: sensobyg.h
#	mig python -target=$(PLATFORM) $(CFLAGS) -python-classname=CollectionDebugMsg $(TOSDIR)/lib/net/ctp/CtpDebugMsg.h CollectionDebugMsg -o $@
#	mig python -target=$(PLATFORM) $(CFLAGS) -python-classname=SerialDataMsg sensobyg.h sensobyg_serial_data_msg -o $@

java-files: $(wildcard *.java) java-dir SerialDataMessage.java CommandMessage.java Constants.java Types.java sensobyg.h 
	javac java/dk/sensobyg/basestation/*.java
	jar cf sensobyg-tinyos.jar -C java .	

java-dir:
	mkdir java
	mkdir java/dk
	mkdir java/dk/sensobyg
	mkdir java/dk/sensobyg/basestation

SerialDataMessage.java:
	mig java -target=null $(CFLAGS) -java-classname=dk.sensobyg.basestation.SerialDataMessage sensobyg.h sensobyg_serial_data_msg -o java/dk/sensobyg/basestation/$@

CommandMessage.java:
	mig java -target=null $(CFLAGS) -java-classname=dk.sensobyg.basestation.CommandMessage sensobyg.h sensobyg_command_msg -o java/dk/sensobyg/basestation/$@

Constants.java:
	ncg -target=$(PLATFORM) $(CFLAGS) -java-classname=dk.sensobyg.basestation.Constants java SensoBygAppC.nc sensobyg.h -o java/dk/sensobyg/basestation/$@

Types.java:
	ncg -target=$(PLATFORM) $(CFLAGS) -java-classname=dk.sensobyg.basestation.Types java SensoBygAppC.nc sensobyg_types.h -o java/dk/sensobyg/basestation/$@

include $(MAKERULES)